package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class TryCatchFinallyDemo {
    public static void main(String[] args) {
        FileOutputStream fos =null;
        try {
            fos = new FileOutputStream("test.dat");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally {
            try {
                if (fos != null){
                    fos.close();
                    System.out.println("s");
                }
            } catch (IOException e){
                e.printStackTrace();
            }
        }
    }
}
